package com.luyou.module.system.service.user;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.luyou.module.system.dal.dataobject.SystemUsers;
import com.luyou.module.system.dal.mapper.SystemUsersMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author luyou
 * @since 2024-07-06
 */
@Service
public class SystemUsersServiceImpl implements SystemUsersService {

    @Resource
    private  SystemUsersMapper systemUsersMapper;

    @Override
    public List<SystemUsers> getUserName(String username) {
        return systemUsersMapper.selectList(new LambdaQueryWrapper<SystemUsers>()
                .eq(SystemUsers::getUsername, username)
                .eq(SystemUsers::getStatus, username)
                .orderByDesc(SystemUsers::getLoginDate)
        );
    }
}
